<?php
/**
 * Object Relational Persistence Mapping Class for table: package_service_item
 *
 * @package	com.athena
 * @author	LHV
 */
class PackageServiceItem extends ORDataObject {

	/**#@+
	 * Fields of table: package_service_item mapped to class members
	 */
	var $package_item_id		= '';
	var $service_room_id		= '';
	/**#@-*/


	/**
	 * DB Table
	 */
	var $_table = 'package_service_item';

	/**
	 * Primary Key
	 */
	var $_key = 'package_item_id';
	
	/**
	 * Internal Name
	 */
	var $_internalName = 'PackageServiceItem';

	/**
	 * Handle instantiation
	 */
	function PackageServiceItem() {
		parent::ORDataObject();
	}
	
	public function addItem($packageItemId, $serviceRoomId) {
		$data = array ('package_item_id' => $packageItemId,
						'service_room_id' => $serviceRoomId);
		$this->populateArray($data);
		$this->persist();
	}
	
	public function delete($packageItemId) {
		$sql = "delete from $this->_table where package_item_id = $packageItemId";
		$this->_execute($sql);
	}			
}
?>
